Upgradeability

The WTD Token is deployed behind a UUPS (Universal Upgradeable Proxy Standard) proxy. This means the token contract's logic can be upgraded while preserving all existing state (balances, allocations, approvals).

How UUPS Works

In the UUPS pattern:

  • A proxy contract holds all state (storage) and delegates calls to an implementation contract

  • The implementation contract contains the logic

  • Upgrades replace the implementation address, not the proxy

  • Users always interact with the same proxy address — it never changes

Upgrade Authorization

Upgrading the WTD Token requires the GOVERNANCE_ROLE. The upgrade authorization is enforced in the _authorizeUpgrade function:

function _authorizeUpgrade(address newImplementation)
    internal
    override
    onlyRole(GOVERNANCE_ROLE)
{}

Only addresses with GOVERNANCE_ROLE can call upgradeToAndCall on the proxy to point it at a new implementation.

circle-info

DEFAULT_ADMIN_ROLE can grant or revoke GOVERNANCE_ROLE. The governance address should be a multisig or timelock for production deployments.

Role Management

Role
Admin
Granted To

GOVERNANCE_ROLE

DEFAULT_ADMIN_ROLE

Initially: deployer

What Can Be Upgraded

An upgrade can change:

  • Logic of existing functions

  • Add new functions

  • Add new state variables (appended to storage)

circle-exclamation

Non-Upgradeable Contracts

Only WTDToken is upgradeable. The other three contracts (WTDSale, WTDVesting, WTDLiquidityManager) are deployed as standard non-upgradeable contracts.